﻿<UserControl x:Class="BlackjackBot.Wpf.Controls.TournamentResults"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="408">
    <Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="34"/>
			<ColumnDefinition Width="340"/>
			<ColumnDefinition Width="34"/>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="36"/>
			<RowDefinition Height="*" />
			<RowDefinition Height="50" />
		</Grid.RowDefinitions>

		<Image Grid.Column="1"  Grid.Row="1"  Source="/Images/LedgerMiddle.png" Stretch="Fill" />
		<Image Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="2" Source="/Images/LedgerTop.png" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="2,0,0,0" />
		<Image Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="2" Grid.RowSpan="2" Source="/Images/LedgerBottom.png" Stretch="None" VerticalAlignment="Top" />

		<Grid Grid.Column="1" Grid.Row="1">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>
			<StackPanel Grid.Row="0">
				<Label HorizontalAlignment="Center" FontFamily="Century" FontSize="24" Style="{StaticResource PrimaryText}" FontStretch="ExtraExpanded" Margin="0,-6,0,0">MULTIPLAYER</Label>
				<Label HorizontalAlignment="Center" FontFamily="Century" FontSize="24" Style="{StaticResource PrimaryText}" FontStretch="ExtraExpanded" Margin="0,-6,0,0">LEADERBOARD</Label>
				<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Margin="0,-8,0,0">
						<Label Content="{Binding Count, FallbackValue=0}" FontFamily="Century" FontSize="20"  Style="{StaticResource PrimaryText}"/>
						<Label FontFamily="Century" FontSize="20" Style="{StaticResource PrimaryText}">Players</Label>
				</StackPanel>
			</StackPanel>

			<Grid Margin="12,0,13,0" Grid.Row="1">
				<Grid.RowDefinitions>
					<RowDefinition Height="30"/>
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="130"/>
				</Grid.ColumnDefinitions>

				<TextBlock Grid.Column="0" Style="{StaticResource HeaderText}" HorizontalAlignment="Left" Margin="12,8,0,0">Bot</TextBlock>
				<TextBlock Grid.Column="1" Style="{StaticResource HeaderText}" HorizontalAlignment="Right"  Margin="6,8,36,0">Bank</TextBlock>
				<Border Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" BorderThickness="0,1" BorderBrush="#FF452821"/>
			</Grid>

			<ScrollViewer Grid.Row="2" Margin="12,0,12,0" VerticalScrollBarVisibility="Auto">
			<ItemsControl ItemsSource="{Binding}" Margin="12,0,16,0">
				<ItemsControl.ItemTemplate>
					<DataTemplate>
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="130"/>
							</Grid.ColumnDefinitions>
							<TextBlock Grid.Column="0" Grid.Row="0" Style="{StaticResource PrimaryTextLists}" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding BotName}"/>
							<TextBlock Grid.Column="1" Grid.Row="0" Style="{StaticResource PrimaryTextLists}" HorizontalAlignment="Right" VerticalAlignment="Center" Text="{Binding Balance, StringFormat={}{0:C}}"/>
							<Border Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" BorderThickness="0,0,0,1" BorderBrush="#FF452821"/>
						</Grid>
					</DataTemplate>
				</ItemsControl.ItemTemplate>
			</ItemsControl>
			</ScrollViewer>
		</Grid>
    </Grid>
</UserControl>
